<?php
//*******************************************************
// Copyright 2008 AMC Websource
// Glenview, Illinois
//
// Page:    class_config.php
// Author:  Mickey Freeman
// Page Function: Class file for handling Abstract configuration data
//
// Created: 09/10/2008
// Version: 1.0
//
// Modified:
//
//*******************************************************

class config extends app_object {
    
    var $err_msg = '';
    
    /**
     * Initializaion Function
     *
     * @return config
     */
    function config()
    {
        $fields = array('config_name',
                        'config_value');
        
        $table = CONFIGURATION_TABLE;
        $id_field = 'config_name';
        
        parent::app_object($fields, $table, $id_field);
    }
    
   /**
    * pulls all configuration data from the database and returns 
    * it in an associative array
    *
    * @return array
    */
   function get_config_data ()
   {
      $html_list = array();
      $query = "SELECT * FROM " . CONFIGURATION_TABLE;

      $result = app_data::mysql_query($query);
      
      while ($row = mysql_fetch_array ($result)) {
         $config_data[$row['config_name']] = $row['config_value'];
      } // end while fetch

      return $config_data;
   }
}